/*  File Name	: Timer.h
 *  Author		: Pang Jiacai
 *	 E-mail		: 823960168@qq.com
 *  Created on	: 2012-6-4
 *  Description:
 */

#ifndef TIMER_H_
#define TIMER_H_
#include "EventHandler.h"

class Timer: public EventHandler
{
public:
	Timer(Reactor *reactor=NULL, std::string name="");
	~Timer();

	virtual int handle_timeout(void);

	virtual int schedule_timer(TimeValue delay,TimeValue interval=TimeValue::zero);

	virtual int cancel_timer(void);

	virtual int refresh_timer(TimeValue time);

	long timer_id(void) const;

	std::string name(void);

protected:
	long timer_id_;
	std::string timer_name_;
};

#endif /* TIMER_H_ */
